home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue57 / DragDrop / TestDragComponentsU.pas < prev   
Encoding:
Pascal/Delphi Source File  |  2000-03-23  |  992 b   |  50 lines

  1. unit TestDragComponentsU;
  2.  
  3. interface
  4.  
  5. uses
  6. {$ifndef Ver100}
  7.   ImgList, //Not found in Delphi 3
  8. {$endif}
  9.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  10.   StdCtrls, ComCtrls, DragEdit, DragButton;
  11.  
  12. type
  13.   TForm1 = class(TForm)
  14.     DragButton1: TDragButton;
  15.     TreeView1: TTreeView;
  16.     ImageList1: TImageList;
  17.     ListView1: TListView;
  18.     DragEdit1: TDragEdit;
  19.     procedure FormCreate(Sender: TObject);
  20.   private
  21.     { Private declarations }
  22.   public
  23.     { Public declarations }
  24.   end;
  25.  
  26. var
  27.   Form1: TForm1;
  28.  
  29. implementation
  30.  
  31. {$R *.DFM}
  32.  
  33. procedure FixControlStyles(Parent: TControl);
  34. var
  35.   I: Integer;
  36. begin
  37.   Parent.ControlStyle := Parent.ControlStyle + [csDisplayDragImage];
  38.   if Parent is TWinControl then
  39.     with TWinControl(Parent) do
  40.       for I := 0 to ControlCount - 1 do
  41.         FixControlStyles(Controls[I]);
  42. end;
  43.  
  44. procedure TForm1.FormCreate(Sender: TObject);
  45. begin
  46.   FixControlStyles(Self)
  47. end;
  48.  
  49. end.
  50.